-- GENERATED SPELL FOR [Twilight Elementalist] --


function spell0_4814(pUnit, Event) --@Earth Shock,n/a--
pUnit:FullCastSpellOnTarget(13728,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4814', 2309, 1)
end

function spell1_4814(pUnit, Event) --@Flame Shock,n/a--
pUnit:FullCastSpellOnTarget(15039,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4814', 12000, 1)
end

function spell2_4814(pUnit, Event) --@Frost Shock,n/a--
pUnit:FullCastSpellOnTarget(12548,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4814', 8254, 1)
end

function spell3_4814(pUnit, Event) --@Shock,n/a--
pUnit:FullCastSpellOnTarget(11824,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_4814', 0, 1)
end

function Sorts_4814(pUnit, Event)
local choix_sorts_4814 = math.random(0, 3)
if choix_sorts_4814 == 0 then
pUnit:RegisterEvent('spell0_4814', 1, 1)
end
if choix_sorts_4814 == 1 then
pUnit:RegisterEvent('spell1_4814', 1, 1)
end
if choix_sorts_4814 == 2 then
pUnit:RegisterEvent('spell2_4814', 1, 1)
end
if choix_sorts_4814 == 3 then
pUnit:RegisterEvent('spell3_4814', 1, 1)
end
end

function mob4814_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_4814', math.random(1500, 3000), 1)
end

function mob4814_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4814_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob4814_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(4814, 1, 'mob4814_Action')
RegisterUnitEvent(4814, 2, 'mob4814_Leave')
RegisterUnitEvent(4814, 3, 'mob4814_Kill')
RegisterUnitEvent(4814, 4, 'mob4814_Die')
